package com.xuzhen.interceptor.one;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class InterceptorHandler implements InvocationHandler {
	private Object object;
	
	private Interceptor inter=new Interceptor();
	
	public void setObject(Object object){
		this.object=object;
	}

	@Override
	public Object invoke(Object proxy, Method method, Object[] args)
			throws Throwable {
		System.out.println(proxy.getClass().getName());
		
		inter.beforDoing();
		
		Object resultObject = method.invoke(object, args);
		
		inter.afterDoing();
		
		return resultObject;
	}

	

}
